<template>
  <div id="cesiumContainer"></div>
</template>

<script>
import Cesium from 'cesium/Cesium';
import widget from 'cesium/Widgets/widgets.css';
export default {
  data() {
    return {};
  },
//   props:['cesiumData'],
  mounted() {
    this.init();
  },
  beforeDestroy() {},
  methods: {
    init() {
        // console.log(this.cesiumData);
        
      let viewerOption = {
        geocoder: false, // 地理位置查询定位控件
        homeButton: false, // 默认相机位置控件
        timeline: false, // 时间滚动条控件
        navigationHelpButton: false, // 默认的相机控制提示控件
        fullscreenButton: false, // 全屏控件
        scene3DOnly: true, // 每个几何实例仅以3D渲染以节省GPU内存
        baseLayerPicker: false, // 底图切换控件
        animation: false, // 控制场景动画的播放速度控件
        selectionIndicator:false // 点击不显示绿色的框框
      };
      let viewer = new Cesium.Viewer(this.$el, viewerOption);
      viewer._cesiumWidget._creditContainer.style.display = 'none'; // 隐藏版权
    //   this.addBillboard(viewer,this.cesiumData);
    },
    // addBillboard(viewer,value) {
    //     // console.log(value.position_x);
        
    //   viewer.entities.add({
    //     position: Cesium.Cartesian3.fromDegrees(Number(value.position_x), Number(value.position_y)),
    //     name: `${value.area}${value.anzhidian}`,
    //     description:`${value.detail}`,
    //     billboard: {
    //       image: '/data/images/facility.gif'
    //     }
    //   });
    //   viewer.zoomTo(viewer.entities);
      
    // }
  }
};
</script>

<style lang='less' scoped>
#cesiumContainer {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
}
 div.cesium-infoBox-title {
  border-bottom-left-radius: 7px;
  height: 30px !important;
  width:100%;
  text-align: left;
}
</style>